package com.hk.core.jdbc.serializer;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.hk.core.jdbc.query.ConditionQueryModel;

import java.io.IOException;

/**
 * 对 {@link ConditionQueryModel} 进行序列化
 *
 * @author Kevin
 * @date 2023-12-10 07:48
 */
public class ConditionQueryModelSerializer extends JsonSerializer<ConditionQueryModel> {

    @Override
    public void serialize(ConditionQueryModel conditionQueryModel, JsonGenerator jsonGenerator,
                          SerializerProvider serializerProvider) throws IOException {
        jsonGenerator.writeObject(conditionQueryModel.toMap());
    }
}
